package cn.doyens.reggie.common;

public class BaseContext {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal();

    /**
     * 将当前登陆者的员工id存入到ThreadLocal中 保存
     * @param id
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    /**
     * 取出当前登陆者的员工id值
     * @return
     */
    public static Long getCurrentId(){
       return threadLocal.get();
    }
}
